package org.huifei.a15_composite;

/**
 * @author: huifei
 * @date: 2017-09-04 10:37
 * 组合模式:将多个对象组合在一起进行操作，常用于表示树形结构中，例如二叉树，数等
 */
public class Test {
    public static void main(String[] args) {
        Tree tree = new Tree("A");
        TreeNode nodeB = new TreeNode("B");
        TreeNode nodeC = new TreeNode("C");

        nodeB.add(nodeC);
        tree.root.add(nodeB);

        System.out.println("build the tree finished!");
    }
}
